# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=py3-logbook
_pkgname=${pkgname#py3-}
pkgver=1.7.0
_pyver=1.7.0.post0
pkgrel=1
pkgdesc="Logging replacement for Python"
url="https://logbook.readthedocs.io/en/stable/"
arch="all"
license="BSD-3-Clause"
depends="python3"
makedepends="py3-gpep517 py3-setuptools py3-wheel python3-dev cython"
checkdepends="py3-pytest py3-pytest-rerunfailures"
subpackages="$pkgname-pyc"
source="$pkgname-$_pyver.tar.gz::https://github.com/getlogbook/logbook/archive/$_pyver.tar.gz"
builddir="$srcdir/$_pkgname-$_pyver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	rm -f tests/test_file_handler.py
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
06fd428c12e6f134729cdd4b02d9bbc7c376d6d870ac2226334ed0bbe1cbf831b702261857b63218cba7bdef12bb31439563d9504b234f7d7811e9cfcbdaf085  py3-logbook-1.7.0.post0.tar.gz
"
